From e5d1731cea1aea2d167c5208bf786af4dcc29167 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 8 Aug 2006 10:03:30 +0100 Subject: [PATCH] [XEND] Fix fallback and error path for domain destruction by domid, or of non-existent domain. I saw the following error message. (A domain of domain name XXX does not exist.) # xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 1019 2 r----- 29.8 # xm destroy XXX Error: an integer is required This patch fixes it to print the following error message. # xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 1019 2 r----- 35.8 # xm destroy XXX Error: the domain 'XXX' does not exist. Signed-off-by: Masaki Kanno --- tools/python/xen/xend/XendDomain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py index 94620c3a9c..52cca550d4 100644 --- a/tools/python/xen/xend/XendDomain.py +++ b/tools/python/xen/xend/XendDomain.py @@ -402,9 +402,9 @@ class XendDomain: val = dominfo.destroy() else: try: - val = xc.domain_destroy(domid) + val = xc.domain_destroy(int(domid)) except Exception, ex: - raise XendError(str(ex)) + raise XendInvalidDomain(str(domid)) return val def domain_migrate(self, domid, dst, live=False, resource=0, port=0): -- 2.30.2